/* notMacPref */

#import <Cocoa/Cocoa.h>
#import <PreferencePanes/NSPreferencePane.h>
#import <notMac.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#define ALERT(head, msg) NSBeginAlertSheet(head, @"OK", nil, nil, [NSApp mainWindow], nil, nil, NULL, NULL, msg, nil);

#define MDNS_TYPE @"_notmac._tcp."
#define MDNS_SSL_TYPE @"_notmacssl._tcp."
#define NOTMAC_URL @"https://notmac.net/"

#define PA_READONLY 0
#define PA_READWRITE 1

@interface notMacPref : NSPreferencePane
{
    IBOutlet NSTabView *mainTabView;

    /* Account tab */
    IBOutlet NSPopUpButton *serviceField;
    IBOutlet NSTextField *usernameField;
    IBOutlet NSTextField *passwordField;
    IBOutlet NSProgressIndicator *progressIndicator;
    IBOutlet NSTextField *statusDisplay;

    /* Storage tab */
    IBOutlet NSTextField *storageAccount;
    IBOutlet NSTextField *storageCapacity;
    IBOutlet NSTextField *storageCapacityUsed;
    IBOutlet NSLevelIndicator *storageIndicator;
    IBOutlet NSMatrix *publicAccess;
    IBOutlet NSButton *publicPasswordProtected;

    /* New Service popup */
    IBOutlet NSTextField *newServiceURL;
    IBOutlet NSWindow *newServiceWindow;

    /* Instance variables */
    NSNetServiceBrowser *browser;
    NSNetServiceBrowser *browserSSL;
    NSMenu *menu;
    notMac *account;
}
- (IBAction)controlTextDidEndEditing:(NSNotification *)aNotification;
- (void)enterServiceURL:(id)sender;
- (IBAction)addServiceURL:(id)sender;
- (IBAction)closeServiceWindow:(id)sender;
- (IBAction)setPublicFolderPassword:(id)sender;
@end
